<html>
<head>
     <meta charset="utf-8">
    <title>linux接口常见问题</title>
</head>

<body>
<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
	<p class="MsoTitle" style="text-align:center;font-size:16pt;font-family:Cambria, serif;font-weight:bold;">
		<span>linux</span><span style="font-family:宋体;">接口常见问题</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span style="font-family:宋体;">开发包里有示例代码</span><span>MainTestKey.java</span><span style="font-family:宋体;">，在开发包里运行</span><span>./run</span><span style="font-family:宋体;">，正确结果如下：</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img width="410" height="376" src="./linux.files/image002.jpg" alt="image005" /></span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<b><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></b><b><span style="font-family:宋体;">返回值为</span><span>0</span></b><b><span style="font-family:宋体;">，返回结果是</span><span>success</span></b><b><span style="font-family:宋体;">，表示调用成功。</span><span></span></b>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span style="font-family:宋体;color:#0070C0;">接口使用方法为：</span><span></span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>System.setProperty("user.dir", libIntekey.so</span><span style="font-family:宋体;">文件所在的目录</span><span>);</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>InteKey mInteKey = new InteKey();</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>if (mInteKey.Ia(FilePath) == 0)&nbsp;&nbsp;//</span><span style="font-family:宋体;">判断文件是否加密</span><span>,0</span><span style="font-family:宋体;">是加密</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>if (mInteKey.Ea(FilePath,KeyID,KeyLevel) == 0) //</span><span style="font-family:宋体;">加密成功</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>if (mInteKey.Da(FilePath,FilePath) == 0) //</span><span style="font-family:宋体;">解密成功</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span style="font-family:宋体;color:#0070C0;">返回错误码：</span><span style="color:#0070C0;"></span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<b><span>======</span></b><b><span style="font-family:宋体;">判断文件是否加密</span><span>======</span></b>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;0&nbsp;&nbsp;</span><span style="font-family:宋体;">是加密文件，其它错误码不用管。</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<b><span>==========</span></b><b><span style="font-family:宋体;">加解密</span><span>==========</span></b>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;0&nbsp;&nbsp;</span><span style="font-family:宋体;">是成功</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-2&nbsp;&nbsp;</span><span style="font-family:宋体;">文件密钥密级不对，请更换正确的</span><span>setup.dll</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-3&nbsp;&nbsp;</span><span style="font-family:宋体;">加密文件没读写权限</span><span>&nbsp;&nbsp;&nbsp;chmod -R 777 *</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-4&nbsp;&nbsp;</span><span style="font-family:宋体;">加密文件的目录没读写权限</span><span>&nbsp;&nbsp;chmod -R 777&nbsp;</span><span style="font-family:宋体;">目录</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<b><span>===========</span></b><b><span style="font-family:宋体;">其它</span><span>===========</span></b>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;-1: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">生成文件头错误</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;-5: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">写文件头错误</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;-8: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">复制文件错误</span><span>"&nbsp;&nbsp;&nbsp;&nbsp;</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;-9: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">秘钥不在允许范围内</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-10: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">该文件不是加密文件</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-11: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">读取文件头错误</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-12: "</span><span style="font-family:宋体;">异常</span><span>:fseek</span><span style="font-family:宋体;">错误</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-13: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">转化前秘钥范围不符</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-14: "</span><span style="font-family:宋体;">异常</span><span>:</span><span style="font-family:宋体;">转化后秘钥范围不符</span><span>"</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>-99:&nbsp;&nbsp;</span><span style="font-family:宋体;">是</span><span>setup.dll</span><span style="font-family:宋体;">的企业标识对不上</span><span>,&nbsp;</span><span style="font-family:宋体;">请更换正确的</span><span>setup.dll</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>999:&nbsp;&nbsp;KeyID数值范围必须是(0-100),KeyLevel数值范围必须是(0-255)</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span style="font-family:宋体;color:#0070C0;">常见问题：</span><span style="color:#0070C0;"></span>
	</h5>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>1. Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.tysoft.office.key.utils.FileKeyCore</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img width="554" height="260" src="./linux.files/image004.jpg" alt="62e9ccc57355a0f253e165b1c665308" /></span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>2.cpuid: Permission denied&nbsp;</span><span style="font-family:宋体;">或者</span>&nbsp;<span style="font-family:宋体;">程序崩溃</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">需要给开发包目录里的所有文件权限，</span><span>chmod&nbsp;&nbsp;-R&nbsp;&nbsp;777&nbsp;&nbsp;*</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>3. checkAuthFile error</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">开发包目录里的</span><span>info.dat</span><span style="font-family:宋体;">文件不对，请更换正确的</span><span>info.dat</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>4. CheckCorpMark failed</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">企业标识对不上，请更换正确的</span><span>setup.dll</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>5. InteNt_JudgePower failed&nbsp;&nbsp;&nbsp;Da -2</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">文件的密钥密级对不上，请更换正确的</span><span>setup.dll</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>6.<span style="background:white;">&nbsp;java.lang.UnsatisfiedLinkError: Can't load library:</span>&nbsp;libIntekey.so<span style="background:white;"></span></span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;</span><span style="font-family:宋体;">调用接口前加上</span><span>System.setProperty("user.dir"</span><span style="font-family:宋体;">，如下：</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;System.setProperty("user.dir", libIntekey.so</span><span style="font-family:宋体;">文件所在的目录</span><span>);</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;InteKey mInteKey = new InteKey();</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;if (mInteKey.Ia(FilePath) == 0)</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>7.</span><span style="line-height:28.9333px;">&nbsp;java.lang.</span><span>ClassNotFoundException: com.tysoft.office.key.utils. InteKey</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">找不到</span><span>intekey.jar</span><span style="font-family:宋体;">包</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>8. check hardno error</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">敲如下命令，返回</span><span>json</span><span style="font-family:宋体;">数据即能连通服务器。</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curl&nbsp;&nbsp;&nbsp;&nbsp;"http://10.2.156.249:8000/intekey/handler/ClientWebApi.ashx?operatetype=checkhardnoforencryptor&amp;hardno=b3b16256"</span>
	</p>
	<h5 align="left" style="font-size:14pt;font-family:Calibri, sans-serif;">
		<span>9. libccallqt.so.1:</span><span style="font-family:宋体;">无法打开共享对象文件</span>
	</h5>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-family:宋体;">每次启动你的程序前，都要运行</span><span>source&nbsp; setenv.sh</span><span style="font-family:宋体;">命令来设置一下环境。</span>
	</p>
	<p class="MsoNormal" align="left" style="font-size:10.5pt;font-family:Calibri, sans-serif;">
		<span>&nbsp;</span>
	</p>
</span>
</h5>
<br><br><br><br>
</body>
</html>